/****************************************************************
 * I am the AC 130 vs Pirate game. I allow the user to control an 
 * AC130 gunship in the hunt for Modern day pirates. The player  
 * will be allowed to roam free across a section of ocean/coastline.  
 * In the water there will be four types of vessels: Merchant  
 * ships that the player must protect, Pirate ships that the player  
 * must identify and destroy, Fishing boats that look like Pirate  
 * ships that the player must not destroy, and Friendly Navy ships  
 * that can capture pirates for extra points. Time permitting there  
 * may also be ground targets to attack. 
 *
 * Key elements of this project will be the Player/AC130, the Ships,  
 * the ShipAI system, the collision grid, the debris controller, the  
 * Ground/Water, Clouds, and scoring system. This project will make  
 * use of an external text file to store useful game parameters,  
 * thus allowing us to play balance the game without recompiling  
 * the executable. 
 *****************************************************************
 * I am the camera class. I contain all the information needed to
 * represent a camera in the world. The Camera's screen varialbe will 
 * act as the back buffer for the game. Its center point will represent
 * where in the world the center of the camera is looking at. Functions
 * like WtoS and StoW will convert world to screen coordinates and 
 * vise versa.
 *****************************************************************/
#include <allegro.h>
#include "point.h"

#ifndef __CAMERA_H__
#define __CAMERA_H__

#define MAXZOOM 1024


class Camera {
public:
	BITMAP * worldSc;
	BITMAP * screen;
	int xoff,yoff;
	float zoom;
	float zoomLow, zoomHigh;

	Point * center;
	Point * out;

public:
	Camera();
	~Camera();

	void Init(BITMAP * src);
		// return value is out point
	Point * STW(Point * tgt);	// screen to world conversion fuction
	Point * WTS(Point * tgt);

	void RendWorld();
	void WorldDrawSprite(BITMAP * src, float x, float y);
	void WorldPivotCtr(BITMAP * src, Point * ctr, float rotate);
	void WorldPivotScaleCtr(BITMAP * src, Point * ctr, float rotate, float scale);

	float STWx(float Xin);
	float STWy(float Yin);
	float WTSx(float Xin);
	float WTSy(float Yin);

	bool IsInScreen(Point * tgt, float rad);

};

#endif